From: Lars Ingebrigtsen Date: Tue, 24 May 2022 15:24:20 +0000 (+0200) Subject: Fix issue with nativecomp tests leaving files behind in /tmp X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~2349^2~455 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=6232932f4bb0630ef4656ed2f8e977fd7fb59952;p=emacs.git Fix issue with nativecomp tests leaving files behind in /tmp * test/src/comp-tests.el (comp-deftest): Ensure that no files are left behind (bug#55611). --- diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 212d9e999f2..e7b534d00ec 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -51,7 +51,14 @@ (doc-string 3)) `(ert-deftest ,(intern (concat "comp-tests-" (symbol-name name))) ,args :tags '(:nativecomp) - ,@docstring-and-body)) + ,@(and (stringp (car docstring-and-body)) + (list (pop docstring-and-body))) + ;; Some of the tests leave spill files behind -- so create a + ;; sub-dir where native-comp can do its work, and then delete it + ;; at the end. + (ert-with-temp-directory dir + (let ((temporary-file-directory dir)) + ,@docstring-and-body))))